// 导入axios实例
import instance from "@/utils/http";
// 导入类型声明文件中类型
import type { LoginForm, LoginRes, MenuData } from "@/types";
import type { AxiosPromise } from "axios";

// 登录API
export const loginAPI = (data: LoginForm): AxiosPromise<LoginRes> => {
    return instance({
        method: 'POST',
        url: '/login',
        data: data
    })
}

// 获取菜单的API
export const getMenuAPI = (): AxiosPromise<MenuData[]> => {
    return instance({
        method: 'GET',
        url: '/menu'
    })
}